home *** CD-ROM | disk | FTP | other *** search
- Path: CS.Arizona.EDU!not-for-mail
- From: dave@CS.Arizona.EDU (Dave Schaumann)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: GCC C++ questions
- Date: 31 Mar 1996 12:09:02 -0700
- Organization: University of Arizona CS Department, Tucson AZ
- Message-ID: <4jml8e$416@lectura.CS.Arizona.EDU>
- References: <314c6829@usura.metropolis.nl> <4ii74q$ss2@hamilton.maths.tcd.ie> <315287AB.41C67EA6@cs.bham.ac.uk>
- NNTP-Posting-Host: lectura.cs.arizona.edu
-
- In article <315287AB.41C67EA6@cs.bham.ac.uk>,
- Derek M Avery <D.M.Avery-CSSE94@cs.bham.ac.uk> wrote:
- >David Malone wrote:
- >>
- >> joskam@usura.metropolis.nl (Jurjen Oskam) writes:
- >>
- >> >Hello there,
- >>
- >> >#include <iostream.h>
- >>
- >> >int main()
- >> >{
- >> > cout << "Hello!" << endl ;
- >> >}
- >>
- >> >This compiles OK, but the executable is 69KB!
-
-
- Well, I included <stdlib.h>, so I could return EXIT_SUCCESS at the
- end, but I got an executable of 68172 bytes. As others have observed,
- the stream library is big. If you want a small "hello" executable,
- call puts() or Write() instead. Or write in assembly language.
-
-
- >have you tried using the -O flag for compiling?
-
- Turning on optimization isn't going to do *anything* to the size
- of the libraries linked in. I just tried it, and got an executable
- of 68140 bytes. That's right, you heard it here first, folks: turning
- on -O results in a savings of a whopping 32 bytes for this program.
- (Which is actually fairly impressive, considering what's available
- to be optimized).
-
- -Dave
-